<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<script type="text/javascript">
	$(document).ready(function(){		 
		$("#addressList").change(function(){
			 $.ajax({
					type:"post",
					url:"${initParam.root}member/findByAddress.do",
					datatype:"json",
					data:"address="+$("#addressList").val(),
					success:function(json){
						  var ta="<table border=1>";
						  ta+="<tr><td>순서</td><td>아이디</td><td>이름</td><td>주소</td></tr>";
				            $.each(json,function(index,data){
				               ta+="<tr>";
				               ta+="<td>"+(index+1)+"</td>";
				               ta+="<td>"+data.id+"</td>";
				               ta+="<td>"+data.name+"</td>";
				               ta+="<td>"+data.address+"</td>";
				               ta+="</tr>";
				            });
				            ta+="</table>";
				         $("#resultView").html(ta);
					}//success
				});//ajax	 
		});//change		
	});//ready
</script>
</head>
<body>
 <select id="addressList" name="address">
	<option value="">--주소--</option>
	<c:forEach items="${requestScope.list}" var="i">
	<option value="${i}">${i}</option>
	</c:forEach>
</select>
<br><br>
<div id="resultView"></div>
<br>